
/**
  ******************************************************************************
  * Copyright 2021 The Microbee Authors. All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * 
  * @file       vehicle_type.h
  * @author     baiyang
  * @date       2022-8-19
  ******************************************************************************
  */

#pragma once

#ifdef __cplusplus
extern "C"{
#endif

/*----------------------------------include-----------------------------------*/
#include <rtconfig.h>
/*-----------------------------------macro------------------------------------*/
#if defined(MB_VEHICLE_ROVER)
#define MICROBEE_BUILD_DIRECTORY MICROBEE_BUILD_Rover
#elif defined(MB_VEHICLE_COPTER)
#define MICROBEE_BUILD_DIRECTORY MICROBEE_BUILD_Copter
#elif defined(MB_VEHICLE_PlANE)
#define MICROBEE_BUILD_DIRECTORY MICROBEE_BUILD_Plane
#elif defined(MB_VEHICLE_SUB)
#define MICROBEE_BUILD_DIRECTORY MICROBEE_BUILD_Sub
#elif defined(MB_VEHICLE_BLIMP)
#define MICROBEE_BUILD_DIRECTORY MICROBEE_BUILD_Blimp
#elif defined(MB_VEHICLE_HELI)
#define MICROBEE_BUILD_DIRECTORY MICROBEE_BUILD_Heli
#else
#error "MICROBEE_BUILD_DIRECTORY needs to be defined!"
#endif

/*
  define common vehicle build types.
  Also note that code needs to support other APM_BUILD_DIRECTORY
  values for example sketches
 */
#define MICROBEE_BUILD_Rover      1
#define MICROBEE_BUILD_Copter     2
#define MICROBEE_BUILD_Plane      3
#define MICROBEE_BUILD_UNKNOWN    5
#define MICROBEE_BUILD_Sub        7
#define MICROBEE_BUILD_Blimp      12
#define MICROBEE_BUILD_Heli       13

#if defined(MICROBEE_BUILD_DIRECTORY)
/*
  using this macro catches cases where we try to check vehicle type on
  build systems that don't support it
 */
#define MB_BUILD_TYPE(type) ((type) == MICROBEE_BUILD_DIRECTORY)

/*
  Copter and heli share a lot of code. This macro makes it easier to check for both
*/
#define MB_BUILD_COPTER_OR_HELI (MB_BUILD_TYPE(MICROBEE_BUILD_Copter) || MB_BUILD_TYPE(MICROBEE_BUILD_Heli))
#else
#error "MICROBEE_BUILD_DIRECTORY needs to be defined!"
#endif
/*----------------------------------typedef-----------------------------------*/

/*----------------------------------variable----------------------------------*/

/*-------------------------------------os-------------------------------------*/

/*----------------------------------function----------------------------------*/

/*------------------------------------test------------------------------------*/

#ifdef __cplusplus
}
#endif



